package com.jwdf.uda.event;

import com.jwdf.uda.utils.EventBusUtil;

/**
 * 类说明：
 */
public class VoteTabCountEvent implements EventBusUtil.IEvent{
    private int voteId;
    private int type;//0评论数,1投票数
    private int commentCount;
    private int voteCount;

    public VoteTabCountEvent(int voteId, int type) {
        this.voteId = voteId;
        this.type = type;
    }

    public int getVoteId() {
        return voteId;
    }

    public void setVoteId(int voteId) {
        this.voteId = voteId;
    }

    public int getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(int commentCount) {
        this.commentCount = commentCount;
    }

    public int getVoteCount() {
        return voteCount;
    }

    public void setVoteCount(int voteCount) {
        this.voteCount = voteCount;
    }

    public static VoteTabCountEvent newInstanceForComment(int voteId, int commentCount) {
        VoteTabCountEvent event = new VoteTabCountEvent(voteId, 0);
        event.setCommentCount(commentCount);
        return event;
    }

    public static VoteTabCountEvent newInstanceForVote(int voteId, int voteCount) {
        VoteTabCountEvent event = new VoteTabCountEvent(voteId, 1);
        event.setVoteCount(voteCount);
        return event;
    }

    public boolean isCommentType() {
        return type == 0;
    }

    public boolean isVoteType() {
        return type == 1;
    }
}
